﻿using Demo.WebApi.Context;
using Demo.WebApi.Models.Products;

namespace Demo.WebApi.Repository
{
    public abstract class BaseRepository<T> where T : class,new()
    {
        public DemoWenApiContext context { get; set; }

        public void Delete(T t)
        {

        }

        public void Insert(T t)
        {
            context.Add<T>(t);
            context.SaveChanges();
        }

        public List<T> Select(T t)
        {
            return context.Set<T>().ToList<T>();
        }

        public void Update(T t)
        {

        }
    }
}
